package com.xuelang.pipeline.app.task.converter;

import com.xuelang.pipeline.client.task.dto.PipelineConfigTaskDTO;
import com.xuelang.pipeline.domain.task.Task;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 流水线配置任务DTO与流水线任务实体转换器
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Mapper
public interface PipelineConfigTaskDTOToTaskConverter {
    PipelineConfigTaskDTOToTaskConverter INSTANCE = Mappers.getMapper(PipelineConfigTaskDTOToTaskConverter.class);

    /**
     * Task转化为PipelineConfigTaskDTO
     * @param task
     * @return
     */
    PipelineConfigTaskDTO taskToPipelineConfigTaskDTO(Task task);

    /**
     * PipelineConfigTaskDTO转化为Task
     * @param pipelineConfigTaskDTO
     * @return
     */
    Task pipelineConfigTaskDTOToTask(PipelineConfigTaskDTO pipelineConfigTaskDTO);
}
